#include "game.h"
#include "display.c"
#include "btns.c"
#include "uart.c"
#include "timer.c"
#include "game.c"

void timer0_ISR() interrupt 1
{
    if (game_frame_count < GAME_FRAME)
    {
        game_frame_count++;
    }
    else
    {
        game_frame_count = 0;
        game_zone_remove_shape();
        if (game_zone_check_shape(game_shape.x, game_shape.y + 1, game_shape.shape))
        {
            game_shape.y++;
        }
        else
        {
            game_zone_add_shape();
            game_zone_new_shape();
        }
        game_zone_add_shape();
        display_refresh_game_zone();
    }
}

void main()
{
    uart_init();
    timer0_init();
    display_init();
    display_init_game_page();
    game_zone_data_init();
    game_zone_new_shape();
    timer0_isr_on();
    while (1)
    {
    }
}